#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int m = 0, n = 0, i = 0, j = 0;
	scanf("%d %d", &m, &n);
	int arr[7][7] = { 0 }; int brr[7][1] = { 0 }; brr[0][0] = 0;
	for (i = 0; i < m; i++)
	{
		for (j = 0; j < n; j++)
		{
			scanf("%d ", &arr[i][j]);
			brr[i][0] += arr[i][j];
		}
	}
	for (i = 0; i < m; i++)
	{
		printf("%d\n", brr[i][0]);
	}
	return 0;
}